package com.fengshang.wedding.domain.service.internal;

import java.util.Collection;

import com.fengshang.wedding.domain.model.internal.MessageEntity;

/**
 * 
 *@author gembin@gmail.com
 * 
 */
public interface IMessagePersistenceService {
	/**
	 * 
	 * @param messageId
	 * @return
	 */
	public MessageEntity findMessageById(int messageId);

	/**
	 * 
	 * @param message
	 * @return
	 */
	public MessageEntity updateMessage(MessageEntity message);

	/**
	 * 
	 * @param topicId
	 * @param message
	 */
	public void createMessage(int topicId, MessageEntity message)throws EntityNotFoundException ;

	/**
	 * 
	 * @param messageId
	 */
	public void removeMessage(int messageId);

	/**
	 * 
	 * @param topicId
	 * @param pageSize
	 * @param currentPage
	 * @return
	 */
	public Collection<MessageEntity> findTopicMessagesByPagination(int topicId,
			int pageSize, int currentPage);

	/**
	 * 
	 * @param query
	 * @param pageSize
	 * @param currentPage
	 * @return
	 */
	public Collection<MessageEntity> findMessagesByPagination(String query,
			int pageSize, int currentPage);

	/**
	 * @param pageSize
	 * @return pages
	 */
	public int getTotalPages(int pageSize);

	/**
	 * with default pageSize 20
	 * 
	 * @return pages
	 */
	public int getTotalPages();
}
